USE [safe_manage]
GO
/****** Object:  Table [dbo].[hse_category_cause]    Script Date: 09/20/2012 22:57:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[hse_category_cause](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[CAUSE_NAME] [varchar](100) NOT NULL,
	[CAUSE_TYPE] [tinyint] NOT NULL,
	[DIRECT_CAUSE_TYPE] [tinyint] NULL,
 CONSTRAINT [PK_hse_category_cause] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[hse_category_cause] ON
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (1, N'冒险进入危险场所 ', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (3, N'攀、坐不安全位置', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (4, N'对易燃、易爆等危险物品处理错误', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (5, N'在起吊物下作业、停留', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (6, N'有分散注意力行为', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (8, N'在必须使用个人防护用品用具的作业或场合中，忽视其使用', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (9, N'操作错误，忽视安全，忽视警告', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (10, N'造成安全装置失效', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (11, N'手代替工具操作', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (12, N'不安全装束', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (13, N'设备、设施、工具、附件有缺陷', 1, 2)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (14, N'使用不安全设备', 1, 2)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (15, N'机器运转时加油、修理、检查、调整、焊接、清扫等工作', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (16, N'防护、保险、信号等装置缺乏或有缺陷', 1, 2)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (17, N'生产（施工）场地环境不良', 1, 2)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (18, N'物体存放不当', 1, 1)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (19, N'教育培训不充分', 2, NULL)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (20, N'对现场工作缺乏检查或指导错误', 2, NULL)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (21, N'其他。', 2, NULL)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (22, N'安全操作规程不健全', 2, NULL)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (23, N'技术和设计上的缺陷', 2, NULL)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (24, N'事故隐患整改不力，事故防范措施不落实', 2, NULL)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (25, N'其他不安全状态', 1, 2)
INSERT [dbo].[hse_category_cause] ([ID], [CAUSE_NAME], [CAUSE_TYPE], [DIRECT_CAUSE_TYPE]) VALUES (26, N'其他不安全行为', 1, 1)
SET IDENTITY_INSERT [dbo].[hse_category_cause] OFF
/****** Object:  Table [dbo].[hse_category]    Script Date: 09/20/2012 22:57:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[hse_category](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[CATEGORY_NAME] [varchar](100) NOT NULL,
	[CATEGORY_TYPE] [tinyint] NOT NULL,
	[DIRECT_CAUSE_ID] [int] NOT NULL,
	[REMOTE_CAUSE_ID] [int] NOT NULL,
	[IS_OTHER] [bit] NOT NULL,
 CONSTRAINT [PK_hse_category] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'如：1，人员的位置；' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'hse_category', @level2type=N'COLUMN',@level2name=N'CATEGORY_TYPE'
GO
SET IDENTITY_INSERT [dbo].[hse_category] ON
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (1, N'冒险进入受限空间', 1, 1, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (2, N'运转设备旁（易受机械伤害）', 1, 3, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (3, N'易被碰撞处（巡检或作业时身躯受到碰撞）', 1, 3, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (4, N'易坠落或摔倒处、高处或临边（高处作业或地面有油等）', 1, 3, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (5, N'物料易喷出、挥发处（容器人孔、采样作业等）', 1, 4, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (6, N'易触电处（易受触电伤害）', 1, 1, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (7, N'起吊物下（起重设备及吊臂半径内）', 1, 5, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (8, N'重复动作或固定姿势（包装流水线操作等）', 1, 6, 21, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (9, N'警戒区内（有安全标示严禁进入的区域等）', 1, 1, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (10, N'其他', 1, 26, 21, 1)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (11, N'安全帽', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (12, N'护目镜及面罩', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (13, N'听力护具（耳塞、耳罩等）', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (14, N'呼吸护具（空气呼吸器、过滤式防毒面具等）', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (15, N'防护手套（焊工手套、绝缘手套、耐油、酸碱手套等）', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (16, N'防护服（一般防护服、特殊防护服等）', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (17, N'防坠落物品（安全带、安全网等）', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (18, N'防护鞋（防砸鞋、防静电鞋、电绝缘鞋等）', 2, 8, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (19, N'其他防护器具', 2, 26, 21, 1)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (20, N'未经许可进行作业', 3, 9, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (21, N'没有气体检测', 3, 9, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (22, N'没有使用安全电压', 3, 10, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (23, N'没有监护人、监护人不在指定区域、现场监督人未指出', 3, 9, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (24, N'受限空间动火作业没有通风', 3, 9, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (25, N'未经许可开动、关停开关或阀门', 3, 4, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (26, N'开动、关停设备时未给信号', 3, 4, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (27, N'未锁定设备或盲板隔离、吹扫', 3, 4, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (28, N'用手代替工具操作', 3, 11, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (29, N'不安全装束（在有旋转零部件的设备旁作业穿过肥大服装、操纵带有旋转零部件的设备时戴手套等）', 3, 12, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (30, N'违章驾驶机动车', 3, 9, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (31, N'缺少程序或程序不完善（程序指：操作规程、管理制度及标准等）', 3, 9, 22, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (32, N'不知道程序要求', 3, 9, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (33, N'知道但未执行程序', 3, 9, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (34, N'其他', 3, 26, 21, 1)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (35, N'工具/设备有缺陷或不完好', 4, 13, 23, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (36, N'工具/设备使用方法不正确', 4, 14, 19, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (37, N'使用不合适的工具和设备', 4, 14, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (38, N'维修运行中的设备', 4, 15, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (39, N'防护、保险、信号等装置缺乏或有缺陷', 4, 16, 24, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (40, N'其他', 4, 25, 21, 1)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (41, N'工作场所不整洁或布局设计不当', 5, 17, 23, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (42, N'工作环境拥挤、堆放杂乱或活动受限', 5, 17, 24, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (43, N'高处、临边、洞口无防护', 5, 16, 23, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (44, N'泄漏', 5, 17, 23, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (45, N'照明不足或过强', 5, 17, 24, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (46, N'通风不良', 5, 17, 24, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (47, N'作业现场乱排放', 5, 18, 20, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (48, N'交叉作业', 5, 17, 24, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (49, N'通道阻塞', 5, 17, 24, 0)
INSERT [dbo].[hse_category] ([ID], [CATEGORY_NAME], [CATEGORY_TYPE], [DIRECT_CAUSE_ID], [REMOTE_CAUSE_ID], [IS_OTHER]) VALUES (50, N'其他', 5, 25, 21, 1)
SET IDENTITY_INSERT [dbo].[hse_category] OFF
/****** Object:  Default [DF_hse_category_IS_OTHER]    Script Date: 09/20/2012 22:57:23 ******/
ALTER TABLE [dbo].[hse_category] ADD  CONSTRAINT [DF_hse_category_IS_OTHER]  DEFAULT ((0)) FOR [IS_OTHER]
GO


/****** Object:  Table [dbo].[problem_hse_category]    Script Date: 09/21/2012 17:49:35 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[problem_hse_category](
	[PROBLEM_ID] [int] NOT NULL,
	[HSE_CATEGORY_ID] [int] NOT NULL,
	[HSE_CATEGORY_TYPE] [tinyint] NOT NULL,
	[DIRECT_CAUSE_ID] [int] NOT null,
	[REMOTE_CAUSE_ID] [int] NOT null
 CONSTRAINT [PK_problem_hse_category] PRIMARY KEY CLUSTERED 
(
	[PROBLEM_ID] ASC,
	[HSE_CATEGORY_ID] ASC,
	[HSE_CATEGORY_TYPE] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

